package com.example.yuecvideo.dao;

import com.example.yuecvideo.utils.ConnectUtil;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

public class DBDao {
    public static ResultSet Select(String sql) throws SQLException {
        Connection connection = ConnectUtil.Connect();
        PreparedStatement preparedStatement = connection.prepareStatement(sql);
        return preparedStatement.executeQuery();
    }
    public static boolean Update(String sql) throws SQLException {
        Connection connection = ConnectUtil.Connect();
        PreparedStatement preparedStatement = connection.prepareStatement(sql);
        return  preparedStatement.execute();
    }


}
